-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update ajv to version 8 #1739
Update ajv to version 8 #1739
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I would prefer not touching the error objects themselves. When we emit them to the user they are not expecting them to be changed by JSON Forms. Instead we should identify the correct errors for our use cases in the mapStateToXYZProps
methods.
In the mean time AJV 8 was released, so we should update to that instead ;) |
2af1bd1
to
024ebae
Compare
024ebae
to
fe3a90f
Compare
f0aab3e
to
7e304cc
Compare
Cloned, and built the repo - as described in Readme. Major fatal errors (errors were there also before npm upgrade): |
@Ketec Thank you very much for taking a look!
Is the error originating from the seed code, i.e. |
@sdirix It is all over the place - core lib utils, reducers, actions. Angular lib root component
|
Which AJV version is in your |
Ok, the seed itself was out of date - it was upgraded to Angular 12 but not AJV 8.
schemaId / jsonPointers / errorDataPath - had to clean up the options for it to compile and run. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much effort do we need to get rid off the already deprecated option?
ced3fb8
to
0c515e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the AJV update we are now properly validating format: 'time'
. It seems that our React Material Time renderer produces an invalid format, leading to always invalid inputs.
Please update the time renderer to store the time in a proper output by default. If a user overwrites the saveFormat and therefore it becomes invalid then that is fine. You can reproduce the issue in the control options
example.
Ajv 8 removes the 'errorDataPath' property option. Error code is refactored to handle the new Ajv error objects without adapting them. The errors stored in the state are now the original errors returned by Ajv. Also removes custom time validation and uses standardized format validations from ajv-formats instead. Additionally the JSON Schema v4 format is no longer added by default. Updates imports and tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much! Looks good to me!
Update to Angular 12
Update to Ajv 8
'instancePath' property and add new getControlPath method that returns a
formatted path pointing to the invalid property and not to its parent.
The errors from JsonFormsCore are now the original errors returned by
Ajv
to the property and not its parent
ajv-formats
as the former was removed